<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>windows(打开一个帮助窗口)</title>
</head>
<script type="text/javascript">
//<![CDATA[

function catchEvent(eventObj,event,eventHandler){
	if(eventObj.addEventListener){
		eventObj.addEventListener(event,eventHandler,false);
	} else if(eventObj.attachEvent){
		event="on" + event;
		eventObj.attachEvent(event,eventHandler);
	}
}

catchEvent(window,"load",setupEvents);

function setupEvents(evnt){
	document.forms[0].elements[0].focus();

	var evtObject=document.getElementById("panicbutton");
	catchEvent(evtObject,"click",openHelp);
}

function openHelp(x){

	var optionString="width=200,height=150,menubar=no,toolbar=no,scrollbars=no,location=no,resizeabe=no";
	var helpWindow=window.open("help.html","test",optionString);
	helpWindow.focus();
	helpWindow.moveTo(x.screenX,x.screenY);
	return false;
}
//]]>
</script>
<body>
<form id="currentForm" action="">
<p>
Your name:<input type="text" size="50"/>
</p>
</form>
<div id="panicbutton" style="width:100px; height:40px; background-color:#f00; padding:5px; marign-left:50px">
<p>Click for Help</p>
</div>
</body>
</html>